﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true"
    CodeBehind="ad_new.aspx.cs" Inherits="LinkCard.AdminCP.Adv.ad_new" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script>
        var $j = jQuery.noConflict(); //set no conflict so you can use with MS AJAX.

        $j(document).ready(function () {
            $j(".cssAdPostDate").datepicker();

            // $j(".EndDate").datepicker();
        });

    </script>
    <link rel="Stylesheet" type="text/css" href="../Uploadify/CSS/uploadify.css" />
    <script type="text/javascript" src="../Uploadify/Scripts/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../Uploadify/Scripts/jquery.uploadify.js"></script>
    <script type="text/javascript">

        $(window).load(
    function () {
        $("#<%=FileUpload1.ClientID %>").fileUpload({
            'uploader': '../Uploadify/Scripts/uploader.swf',
            'cancelImg': 'images/cancel.png',
            'buttonText': 'Browse Files',
            'script': 'AdsUpload.ashx',
            'folder': 'uploads',
            'fileDesc': 'Adv Files(JPG, PNG, GIF, SWF)',
            'fileExt': '*.jpg;*.png;*.gif;*.swf;',
            'sizeLimit': '500000000',
            'multi': true,
            'auto': true,
            'onComplete': function (event, ID, fileObj, response, data) {


                $(".cssAdFilePath").val(response);
                //alert($(".cssAdFilePath").val());
                if ($(".cssAdFilePath").val().indexOf(".swf") != -1) {
                    $("#FileUploadDiv").html("<embed  width='220' src='/FileUpload/Adv/" + $(".cssAdFilePath").val() + "' wmode='transparent' quality='high'    pluginspage='http://www.macromedia.com/go/getflashplayer'        type='application/x-shockwave-flash'>");
                }
                else {

                    $("#FileUploadDiv").html("<img  src=/FileUpload/Adv/" + $(".cssAdFilePath").val() + "    width=220 />")
                }


                $("#FileUploadDiv").show();
            }
        });
    }
);

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <section id="content">
  <section class="container_12 clearfix">
    <section id="main" class="grid_12">
      <article>
        <div class="h1">Thêm mới quảng cáo</div>
        
          <dl class="inline">

            <dt>
              <label >Tiêu đề:</label>
            </dt>
            <dd>
              <input type="text"   class="big" id="AdTitle" runat="server" />
            </dd>
            <dt>
              <label >File: </label>
            </dt>
            <dd>
              
              <input type="hidden" id="AdFilePath" runat="server" class="cssAdFilePath"   />
            
                            <asp:FileUpload ID="FileUpload1" runat="server" />
            </dd>
            <dt></dt>
            <dd><div id="FileUploadDiv" style="display:none;">
            </div></dd>
            <dt>
              <label >Link:</label>
            </dt>
            <dd>
              <input type="text"   class="big" id="AdLink" runat="server" />
            </dd>
            <dt>
              <label >Vị trí:</label>
            </dt>
            <dd>
              
              <asp:DropDownList id="AdPosition" runat="server"></asp:DropDownList>
            </dd>
            
            
            <dt>
              <label >Ngày đăng:</label>
            </dt>
            <dd>
              <input type="text"  id="AdPostDate" class="cssAdPostDate" runat="server" /> (mm/dd/yyyy)
                 
            </dd>
           <dt><label>Hiển thị:</label> </dt>
           <dd>
             <asp:CheckBox ID="isActive" runat="server" Checked="true" /> 
           </dd>
  
          </dl>
          <p>
          
          <asp:Button class="button big" style="width:auto;" Text="Lưu" ID="btnAdd" runat="server" 
                  onclick="btnAdd_Click"  />
          </p>
       
      </article>
    </section>
  </section>
</section>
</asp:Content>
